package com.src;

import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.RadioGroup.OnCheckedChangeListener;

/**
 * 
 * @author Administrator 手动Checked
 */
public class Look extends Activity {
	private RadioGroup radioGroup = null;
	private RadioButton r0, r1, r2, r3, r4, r5;
	private ImageView imageView = null;
	private TextView textView = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		textView = (TextView) findViewById(R.id.textView);
		imageView = (ImageView) findViewById(R.id.imageView);
		radioGroup = (RadioGroup) findViewById(R.id.radioGroup);
		r0 = (RadioButton) findViewById(R.id.radio0);
		r1 = (RadioButton) findViewById(R.id.radio1);
		r2 = (RadioButton) findViewById(R.id.radio2);
		r3 = (RadioButton) findViewById(R.id.radio3);
		r4 = (RadioButton) findViewById(R.id.radio4);
		r5 = (RadioButton) findViewById(R.id.radio5);
		radioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {

			@Override
			public void onCheckedChanged(RadioGroup group, int checkedId) {
				if (checkedId == r0.getId()) {
					imageView.setImageResource(R.drawable.inner);
					textView.setText("A");
				} else if (checkedId == r1.getId()) {
					imageView.setImageResource(R.drawable.b);
					textView.setText("B");
				} else if (checkedId == r2.getId()) {
					imageView.setImageResource(R.drawable.c);
					textView.setText("C");
				} else if (checkedId == r3.getId()) {
					imageView.setImageResource(R.drawable.d);
					textView.setText("D");
				} else if (checkedId == r4.getId()) {
					imageView.setImageResource(R.drawable.e);
					textView.setText("E");
				} else if (checkedId == r5.getId()) {
					imageView.setImageResource(R.drawable.f);
					textView.setText("F");
				}
			}
		});

	}

	public void Show(String str) {
		Toast toast = Toast.makeText(this, str, Toast.LENGTH_SHORT);
		// toast.setGravity(Gravity.TOP, 0, 220);
		toast.show();
	}

}
